package com.qfedu.mbtiapi.controller;

import com.qfedu.mbtiapi.entity.Question;
import com.qfedu.mbtiapi.service.QuestionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;

/**
 * 测试题表(Question)表控制层
 *
 * @author makejava
 * @since 2024-11-01 10:53:37
 */
@RestController
@RequestMapping("api/question")
@Tag(name = "测试问题")
public class QuestionController {
    /**
     * 服务对象
     */
    @Resource
    private QuestionService service;

    @Operation(summary = "测试的测试题")
    @GetMapping("testquestions")
    public List<Question> queryByTest(Integer id){
        return service.queryByUtid(id);
    }
    @Operation(summary = "回答测试题")
    @GetMapping("answer")
    public String answer(Integer id,String answer){
        return service.updateAnswer(id, answer);
    }
}

